//
// Created by ziya on 2021/11/2.
//

#ifndef THREAD_POOL_OBJECTMONITOR_H
#define THREAD_POOL_OBJECTMONITOR_H

#include "JavaThread.h"
#include "ObjectWaiter.h"

class ObjectMonitor {

public:
    void enter(JavaThread *javaThread);

    void exit(JavaThread *javaThread);

public:
    JavaThread* _owner = NULL;

    int _recursions;

    ObjectWaiter* _cxq;

    void AddTask(ObjectWaiter *node);

    void DequeueSpecificTask(ObjectWaiter *node);

    ObjectWaiter *DequeueTask();
};


#endif //THREAD_POOL_OBJECTMONITOR_H
